/**
 * @(#) Subject.java
 */

package it.unibo.iss.domotica.consumptionControlling;

import java.util.ArrayList;
import java.util.List;

public abstract class Subject
{
	private List<Observer> observers;
	
	public Subject() {
		observers = new ArrayList<Observer>();
	}
	
	public void attach(Observer o) {
		observers.add(o);
	}
	
	public void detach(Observer o) {
		observers.remove(o);
	}
	
	public void sendNotify() {
		for(Observer o : observers) {
			o.update();
		}
	}
	
	
}
